// 系统管理的api接口
import { $post } from '@/utils/request';
import {
  roleAddUserParams,
  searchByParams,
  searchToolKitParams,
  addToolKitParams,
  editToolKitParams,
  delToolKitParams,
  searchToolMaterialParams,
  addToolMaterialParams,
  editToolMaterialParams,
  delToolMaterialParams,
  searchBufferBinParams,
  addBufferBinParams,
  editBufferBinParams,
  delBufferBinParams,
  searchBinMaterialParams,
  addBinMaterialParams,
  editBinMaterialParams,
  delBinMaterialParams,
  searchLargeShelvesParams,
  addLargeShelvesParams,
  editLargeShelvesParams,
  delLargeShelvesParams,
  searchLargeMaterialParams,
  addLargeMaterialParams,
  editLargeMaterialParams,
  delLargeMaterialParams,
  searchLogParams,
  overLogParams,
  clearLogParams,
  goLogParams,
  searchPersonParams,
  addPersonParams,
  editPersonParams,
  delPersonParams,
  searchConsoleParams,
  updateConsoleStatusParams,
  addConsoleParams,
  deleteConsoleParams,
} from './types';

// 巷道查询
export function searchRoad(data: any) {
  return $post('/systemRoadController/queryRoad', data);
}

// 巷道启用和禁用
export function updateRoadStatus(data: roleAddUserParams) {
  return $post('/systemRoadController/updateRoadStatus', data);
}

// 查询立体库
export function searchLibrary(data: searchByParams) {
  return $post('/MsSslShelvesRest/searchByParams/v1', data);
}

// 工作包器具查询
export function searchToolKit(data: searchToolKitParams) {
  return $post('/MsWpTool/searchByPage/v1', data);
}
// 工作包器具新增
export function addToolKit(data: addToolKitParams) {
  return $post('/MsWpTool/saveMany/v1', data);
}
// 工作包器具修改
export function editToolKit(data: editToolKitParams) {
  return $post('/MsWpTool/updateMany/v1', data);
}
// 工作包器具删除
export function delToolKit(data: delToolKitParams[]) {
  return $post('/MsWpTool/deleteMany/v1', data);
}

// 工作包物料查询
export function searchToolMaterial(data: searchToolMaterialParams) {
  return $post('/msTaskPackage/searchPackageInfo', data);
}
// 工作包物料新增
export function addToolMaterial(data: addToolMaterialParams) {
  return $post('/msTaskPackage/insertPackageMaterialInfo', data);
}
// 工作包物料修改
export function editToolMaterial(data: editToolMaterialParams) {
  return $post('/msTaskPackage/updatePackageMaterial', data);
}
// 工作包物料删除
export function delToolMaterial(data: delToolMaterialParams) {
  return $post('/msTaskPackage/deletePackageMaterial', data);
}

// 缓存料箱查询
export function searchBufferBin(data: searchBufferBinParams) {
  return $post('/msworkbin/searchByPage', data);
}
// 缓存料箱新增
export function addBufferBin(data: addBufferBinParams) {
  return $post('/msworkbin/save', data);
}
// 缓存料箱修改
export function editBufferBin(data: editBufferBinParams) {
  return $post('/msworkbin/update', data);
}
// 缓存料箱删除
export function delBufferBinl(data: delBufferBinParams) {
  return $post('/msworkbin/deleteById', data);
}

// 缓存料箱物料获取最大组号
export function searchGroupNo(data: any) {
  return $post('/workbinMaterialMaintain/queryMaxGroup', data);
}
// 缓存料箱物料查询
export function searchBinMaterial(data: searchBinMaterialParams) {
  return $post('/workbinMaterialMaintain/workbinMaterialMaintainSearch', data);
}
// 缓存料箱物料新增
export function addBinMaterial(data: addBinMaterialParams) {
  return $post('/workbinMaterialMaintain/workbinMaterialMaintainInsert', data);
}
// 缓存料箱物料修改
export function editBinMaterial(data: editBinMaterialParams) {
  return $post('/workbinMaterialMaintain/workbinMaterialMaintainUpdate', data);
}
// 缓存料箱物料删除
export function delBinMaterial(data: delBinMaterialParams) {
  return $post('/workbinMaterialMaintain/workbinMaterialMaintainDelete', data);
}

// 大件区货架查询
export function searchLargeShelves(data: searchLargeShelvesParams) {
  return $post('/msPartShelves/searchByPage', data);
}
// 大件区货架新增
export function addLargeShelves(data: addLargeShelvesParams) {
  return $post('/msPartShelves/save', data);
}
// 大件区货架修改
export function editLargeShelves(data: editLargeShelvesParams) {
  return $post('/msPartShelves/update', data);
}
// 大件区货架删除
export function delLargeShelves(data: delLargeShelvesParams) {
  return $post('/msPartShelves/delete', data);
}

// 大件区物料查询
export function searchLargeMaterial(data: searchLargeMaterialParams) {
  return $post('/msBulkyItems/msBulkyItemsSearch', data);
}
// 大件区物料新增
export function addLargeMaterial(data: addLargeMaterialParams) {
  return $post('/msBulkyItems/msBulkyItemsInsert', data);
}
// 大件区物料修改
export function editLargeMaterial(data: editLargeMaterialParams) {
  return $post('/msBulkyItems/msBulkyItemsUpdate', data);
}
// 大件区物料删除
export function cLargeMaterial(data: delLargeMaterialParams) {
  return $post('/msBulkyItems/msBulkyItemsDelete', data);
}

// 日志查询
export function searchLog(data: searchLogParams) {
  return $post('/MsSslShelvesRest/searchLog', data);
}
// 结束日志
export function overLog(data: overLogParams) {
  return $post('/outStoreroom/taskFinish', data);
}
// 日志-清理占位
export function clearLog(data: clearLogParams) {
  return $post('/outStoreroom/isBackFinish', data);
}
// 日志-下发任务
export function goLog(data: goLogParams) {
  return $post('/taskGoOn/LoggingGoingOn', data);
}

// 配送员信息查询
export function searchPerson(data: searchPersonParams) {
  return $post('/msDeliveryCrew/msDeliveryCrewSearch', data);
}
// 配送员信息新增
export function addPerson(data: addPersonParams) {
  return $post('/msDeliveryCrew/msDeliveryCrewInsert', data);
}
// 配送员信息修改
export function editPerson(data: editPersonParams) {
  return $post('/msDeliveryCrew/msDeliveryCrewUpdate', data);
}
// 配送员信息删除
export function delPerson(data: delPersonParams) {
  return $post('/msDeliveryCrew/msDeliveryCrewDelete', data);
}

// 分拣台信息查询
export function searchSortingTable(data: searchConsoleParams) {
  return $post('/MsConsoleRest/searchSortingTableByPage', data);
}
// 接收台信息查询
export function searchReceiveTable(data: searchConsoleParams) {
  return $post('/MsConsoleRest/searchReceiveTableByPage', data);
}
// 分配任务
export function distributionTask(data: any) {
  return $post('/MsConsoleRest/distributionTask', data);
}
// 分拣台上线
export function updateOnlineStatus(data: any) {
  return $post('/MsConsoleRest/updateOnlineStatus', data);
}
// 分拣台下线
export function updateOfflineStatus(data: any) {
  return $post('/MsConsoleRest/updateOfflineStatus', data);
}
// 新增操作台
export function insertNewConsole(data: addConsoleParams) {
  return $post('/MsConsoleRest/insertNewConsole', data);
}
// 修改操作台
export function updateConsole(data: updateConsoleStatusParams) {
  return $post('/MsConsoleRest/updateMsConsole', data);
}
// 删除操作台
export function deleteConsole(data: deleteConsoleParams) {
  return $post('/MsConsoleRest/deleteMsConsole', data);
}

// 立体库集成
export function debDoTask(data: any) {
  return $post('/MsSslShelvesRest/debuggingDoTask', data);
}

// 查看出库任务
export function taskOutQuery(data: any) {
  return $post('/MsSslShelvesRest/taskOutQuery', data);
}

// 一键叫箱
export function outBatch(data: any) {
  return $post('/MsSslShelvesRest/outBatch', data);
}

// 开启巷道
export function rowTurnOn(data: any) {
  return $post('/outStoreroom/rowTurnOn', data);
}
// 关闭巷道
export function rowTurnDown(data: any) {
  return $post('/outStoreroom/rowTurnDown', data);
}
// 立体库维护-修改
export function sysLibraryChange(data: any) {
  return $post('/MsSslShelvesRest/update/v1', data);
}

// 物料查询
export function queryMdsItemList(data: any) {
  return $post('/mdsItemController/queryMdsItemList', data);
}

// 文件查询
export function queryFileById(data: any) {
  return $post('/mdsItemController/queryFileById', data);
}
